﻿function login_submit() {
    var sUser=$("#uipc_user").val();
    var sPass = $.md5($("#uipc_pass").val());
    if (!sUser) {
        alert("用户名不能为空");
        return;
    }
    $.ajax({
        url: "api.asp",
        type: "post",
        data: {
            "action": "login",
            "user": sUser,
            "pass":sPass
        },
        success: function (data) {
            var oRet = pages.common.parseJSON(data);
            if (oRet) {
                if (oRet.ref == "ok") {
                    location.href = "admin.asp";
                } else {
                    alert(oRet.msg);
                    return;
                }
            } else {
                alert("信息传输错误！请重新尝试！");
                return;
            }
        }
    });
}